package pcsr.simulator.ui;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JComponent;
import java.awt.Color;
import java.awt.geom.Ellipse2D;

public class SimulatorEmitter extends JComponent {

	private static final long serialVersionUID = 1L;
	
	private Ellipse2D circle = new Ellipse2D.Float();
	 
	private Color FillColor = new Color(1f, 1f, 0.5f, 1f);// Color.yellow;
	
	/**
	 * This is the default constructor
	 */
	public SimulatorEmitter() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setPreferredSize(new Dimension(50, 50));
		this.setMaximumSize(this.getPreferredSize());
		this.setLayout(null);
		this.setSize(50, 50);
		
		circle.setFrame(this.getLocation(), this.getSize());
		
	}
	
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		Graphics2D g2 = (Graphics2D)g;
		
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		
		/** draws the node */
		g2.setColor(FillColor);
		g2.fill(circle);
	}
}
